[WIP] Add fermionic support to belief-propagation simple update#155
Draft
mtfishman wants to merge 7 commits into
Draft
[WIP] Add fermionic support to belief-propagation simple update#155mtfishman wants to merge 7 commits into
mtfishman wants to merge 7 commits into
Conversation
Keep belief-propagation messages as operators and normalize them by their trace rather than an entrywise sum, which stays sign correct on fermionic bonds where the entrywise sum can flip the odd-parity block. Gauge the simple-update tensors with the balanced square root and inverse square root of the Hermitian-projected bond messages. Depends on the operator-form Hermitian factorizations added in the ITensorBase mf/operator-sqrth branch.
The BP simple-update gauge absorbs an operator-valued square root of each incoming message into the state tensor. Contracting it with `*` returns an operator, so the updated state is written back as an operator and rejected by the state network. Take the underlying tensor of each gauge (`ITB.state`) before contracting, so the gauged state stays a plain tensor while the index arrows still carry the fermion sign. Requires the operator `dimnametype` fix from ITensor/ITensorBase.jl#225. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Store both directed messages of a bond uniformly as the bond (ket output) and an auxiliary leg (bra input), with conj(S)/S into the two endpoints, and build the initial identity messages on the source-side ket axis so their ket leg is dual to the destination bond. The gauge projects the message Hermitian and takes the balanced square-root / inverse-square-root in whichever bipartition is positive semidefinite, which recovers the odd-parity fermion sign in both directions. Migrate the message-update path to the ITensorBase 0.13 outputnames/inputnames API and bump to 0.9.10.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #155 +/- ##
==========================================
- Coverage 84.89% 0.00% -84.90%
==========================================
Files 15 13 -2
Lines 662 636 -26
==========================================
- Hits 562 0 -562
- Misses 100 636 +536
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Replace the try/catch PSD-bipartition selection in `message_gauge` with a plain transposed gauge. The two directed bond messages are now built from the PSD singular-value message `conj(S)`. The reverse direction is its arrow flip via `dualize`, which toggles `isdual` and keeps the odd-parity block, rather than `conj`, which negates the odd block and breaks PSD. Free-fermion validation is exact to machine precision on trees with no fallback. `dualize` is a temporary element-wise hack that pulls in a temporary `GradedArrays` dependency. Both stand in for a proper backend-agnostic duality-flip primitive. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The reverse directed message is S with its bond orientation reversed, which is the ribbon twist of S (-1 on the odd-parity sector). Both directed messages are then positive semidefinite in the transposed gauge, so the gauge needs no fallback. This replaces the element-wise dualize helper with a name-keyed twist and twist!. Also simplify the belief-propagation message unwrap to state.(messages), relying on state being idempotent.
mtfishman
force-pushed
the
mf/fermion-bp-sign
branch
from
July 24, 2026 17:36
03f6abd to
0f0ec76
Compare
…n twist Each directed simple-update message is now the doubled contraction of the gate factor with its conjugate, rather than being read off the singular-value spectrum as conj(S) and a ribbon-twisted S. The graded contraction of a factor with its conjugate carries the odd-parity fermion sign on its own, so the explicit ribbon twist (and the direct GradedArrays dependency it needed) is gone.
mtfishman
force-pushed
the
mf/fermion-bp-sign
branch
from
July 24, 2026 17:38
0f0ec76 to
8d169d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds fermionic support to the belief-propagation simple-update apply-gate (
apply_operators). The odd-parity sign on a fermionic bond needs care in the gauge. Each directed message is built as the doubled contraction of the gate factor with its conjugate, which carries the sign, and the gauge roots each message in the bipartition where it is positive semidefinite. The bosonic path is unchanged.TODO
FermionParity) apply-gate test coverage